package proxy.dynamic;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * ClassName:PeopleHanlder <br/>
 * description:  <br/>
 * Date:     2019/6/17、15:23 <br/>
 *
 * @author Plank
 */
public class PeopleHanlder implements InvocationHandler {
    private Object obj;

    public PeopleHanlder() {
    }

    public PeopleHanlder(Object obj) {
        this.obj = obj;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("代理前");
        Object invoke=method.invoke(obj,args);
        System.out.println("代理后");
        return invoke;
    }
}
